Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Oct 2014, 14:47
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to setup a menuitem for input into editor? solved
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Thu 21 Feb 2013, 16:14    Post_subject:  How to setup a menuitem for input into editor? solved  

Hello Everyone,

I have been trying for last 2hrs too take the menuitem so that it inputs a file into the editor for reading.

Code:
<menu label="_Timelines" use-underline="true">
   <menuitem stock-id="gtk-open" label="1">
      <action>cat > '$WORKDIR'/001 > '$WORKDIR'/reading</action>
      <action>refresh:EDITOR</action>
      </menuitem>
   
   </menu>


If I need to show all the code let me know and I will post that as well.

Thanks for any help

Cheers

Edited_time_total
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Thu 21 Feb 2013, 19:54    Post_subject:  

Hey Oldyeller

The first > is unnecessary, should be cat '$WORKDIR'/1 > ...

Just in case - a stand alone example. Wink
Code:
#! /bin/bash

WORKDIR=/tmp
echo "blablabla" > $WORKDIR/reading
echo "completely different blablabla" > $WORKDIR/1

export MAIN='
<window>
  <vbox>
    <menubar>
      <menu label="_Timelines" use-underline="true">
        <menuitem stock-id="gtk-open" label="1">
          <action>cat '$WORKDIR'/1 > '$WORKDIR'/reading</action>
          <action>refresh:EDITOR</action>
        </menuitem>
      </menu>
    </menubar>
    <edit>
      <variable>EDITOR</variable>
      <input file>'$WORKDIR'/reading</input>
    </edit>
  </vbox>
</window>
'

gtkdialog -p MAIN

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
oldyeller


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Thu 21 Feb 2013, 21:20    Post_subject:  

Hi SFR,

Will give it a try with the rest of my code.

Will this allow me to use a input file with the information that I want displayed or will I need to type it in for the echo as you did for the example.


Cheers
Back to top
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Fri 22 Feb 2013, 04:23    Post_subject:  

Yes, I just used 'echo' to make sure that input files for <edit> do exist and are not empty.
It will work with any textual files.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0456s ][ Queries: 11 (0.0044s) ][ GZIP on ]