GTK: add refresh button

This commit is contained in:
Julian Ospald 2015-12-25 23:24:43 +01:00
parent 3edd3c8a19
commit 61b2313320
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
4 changed files with 22 additions and 3 deletions

View File

@ -262,9 +262,6 @@
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkEntry" id="urlBar">
<property name="visible">True</property>
@ -274,6 +271,21 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="refreshView">
<property name="label">gtk-refresh</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>

View File

@ -207,6 +207,8 @@ startMainWindow startdir = do
"rcFilePaste"
rcFileDelete <- builderGetObject builder castToImageMenuItem
"rcFileDelete"
refreshView <- builderGetObject builder castToButton
"refreshView"
-- create initial list store model with unsorted data
rawModel <- newTVarIO =<< listStoreNew

View File

@ -111,6 +111,10 @@ setCallbacks mygui myview = do
"v" <- fmap glibToString eventKeyName
liftIO $ operationFinal mygui myview
_ <- refreshView mygui `on` buttonActivated $ do
cdir <- liftIO $ getCurrentDir myview
refreshTreeView' mygui myview cdir
-- menubar-file
_ <- menubarFileQuit mygui `on` menuItemActivated $ mainQuit
_ <- menubarFileOpen mygui `on` menuItemActivated $

View File

@ -63,6 +63,7 @@ data MyGUI = MkMyGUI {
, rcFileMove :: ImageMenuItem
, rcFilePaste :: ImageMenuItem
, rcFileDelete :: ImageMenuItem
, refreshView :: Button
, urlBar :: Entry
, statusBar :: Statusbar
, treeView :: TreeView